package cn.schoolwow.quickdao.module.database.dml.json.service.delete;

import cn.schoolwow.quickdao.module.database.dml.json.flow.common.SetDeleteJSONObjectParameterFlow;
import cn.schoolwow.quickdao.module.database.dml.json.flow.common.SetDeleteJSONObjectStatementFlow;
import cn.schoolwow.quickdao.module.database.dml.json.flow.common.check.CheckUniqueFieldNameFlow;
import cn.schoolwow.quickdao.module.database.parent.flow.executor.ExecuteUpdateConnectionFlow;
import cn.schoolwow.quickflow.QuickFlowExecutor;
import cn.schoolwow.quickflow.flow.CompositeBusinessFlow;

public class DeleteJSONObjectCompositeBusiness implements CompositeBusinessFlow {
    @Override
    public void executeCompositeBusiness(QuickFlowExecutor quickFlowExecutor) {
        quickFlowExecutor.next(new CheckUniqueFieldNameFlow())
                .next(new SetDeleteJSONObjectStatementFlow())
                .next(new SetDeleteJSONObjectParameterFlow())
                .putTemporaryData("name", "删除JSONObject")
                .next(new ExecuteUpdateConnectionFlow());
    }

    @Override
    public String name() {
        return "删除JSON对象复合流程";
    }
}
